#include <sxStoredMesh_Archetype.h>
#include <sxMappedSurface.h>

Sx::Physics::Archetypes::Objects::StoredMesh_Archetype::StoredMesh_Archetype(const std::shared_ptr<RendererImplementation>& renderer) :
	GeometricObject_Archetype(std::make_shared<Mesh>(), renderer, std::make_shared<StoredPhysicalRepresentation>()) {

}

Sx::Physics::Archetypes::Objects::StoredMesh_Archetype::~StoredMesh_Archetype() {}

bool Sx::Physics::Archetypes::Objects::StoredMesh_Archetype::setStoredData(const Mesh& mesh, const StoredPhysicalRepresentation& storedRepresentation) {
	// copy data from mesh to this->object
	this->object->setSurface(mesh.getSurface());
	this->object->setColor(mesh.getColor());
	// copy data from storedRepresentation to this->physicalRep
	this->physicalRepresentation->setData(storedRepresentation);
	return true;
}

bool Sx::Physics::Archetypes::Objects::StoredMesh_Archetype::pick(const Eigen::Vector3f& pickSegmentStart, const Eigen::Vector3f& pickSegmentEnd, Eigen::Vector3f& intersectionPoint) { return false; }
bool Sx::Physics::Archetypes::Objects::StoredMesh_Archetype::intersect(const Eigen::Vector3f& segment_p0, const Eigen::Vector3f& segment_p1, Eigen::Vector3f& intersectionPoint) { return false; }
